Last active
September 27, 2015 15:28
-
-
Save 7shi/1291551 to your computer and use it in GitHub Desktop.
Makefile for UNIX V6's C compiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = v6cc | |
AS = v6as | |
RUN = -v6run | |
ROOT = /usr/local/v6root | |
CFLAGS = -O | |
LDFLAGS = -s -n | |
SRC0 = c00.c c01.c c02.c c03.c c04.c c05.c | |
SRC1 = c10.c c11.c c12.c c13.c | |
SRC2 = c20.c c21.c | |
OBJ0 = $(SRC0:.c=.o) c0t.o | |
OBJ1 = $(SRC1:.c=.o) c1t.o | |
OBJ2 = $(SRC2:.c=.o) | |
all: c0 c1 c2 cc | |
cvopt: cvopt.c | |
$(CC) $< | |
mv a.out $@ | |
table.i: cvopt table.s | |
$(RUN) cvopt table.s $@ | |
table.o: table.i | |
$(AS) table.i | |
mv a.out $@ | |
c0tc.s: c0t.s | |
cat $< | sed "s/fpp = 1/fpp = 0/" > $@ | |
c0t.o: c0tc.s | |
$(AS) $< | |
mv a.out $@ | |
c1t.o: c1t.s | |
$(AS) $< | |
mv a.out $@ | |
c0: $(OBJ0) | |
$(CC) $(LDFLAGS) $(OBJ0) | |
mv a.out $@ | |
c1: $(OBJ1) table.o | |
$(CC) $(LDFLAGS) $(OBJ1) table.o | |
mv a.out $@ | |
c2: $(OBJ2) | |
$(CC) $(LDFLAGS) $(OBJ2) | |
mv a.out $@ | |
cc: ../s1/cc.c | |
$(CC) $(LDFLAGS) $< | |
mv a.out $@ | |
install: all | |
cp cc $(ROOT)/bin | |
cp c0 c1 c2 $(ROOT)/lib | |
clean: | |
rm -f *.o c0tc.s table.i a.out cvopt c0 c1 c2 cc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment