scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

Makefile (1356B)


      1 .POSIX:
      2 
      3 DIRS =\
      4 	amd64-sysv\
      5 	arm64-sysv\
      6 	i386-sysv\
      7 	qbe\
      8 	qbe_amd64-sysv\
      9 	qbe_arm64-sysv\
     10 	z80-scc\
     11 
     12 PROJECTDIR = ../../../..
     13 include $(PROJECTDIR)/scripts/rules.mk
     14 
     15 MORE_LDLIBS = -lscc
     16 
     17 OBJS =\
     18 	main.o\
     19 	parser.o\
     20 	peep.o\
     21 	symbol.o\
     22 	node.o\
     23 	code.o\
     24 	optm.o\
     25 
     26 TARGET  =\
     27 	cc2-amd64-sysv\
     28 	cc2-i386-sysv\
     29 	cc2-qbe_amd64-sysv\
     30 	cc2-qbe_arm64-sysv\
     31 	cc2-z80-scc\
     32 
     33 all:
     34 	+@$(MAKE) $(DIRS)
     35 	+@$(MAKE) $(TARGET)
     36 	@cp $(TARGET) $(LIBEXEC)/scc
     37 
     38 main.o: error.h
     39 qbe_amd64-sysv qbe_arm64-sysv: qbe
     40 qbe_amd64-sysv: amd64-sysv
     41 qbe_arm64-sysv: arm64-sysv
     42 
     43 error.h: cc2.h
     44 	rm -f $@;\
     45 	trap 'rm -f $$$$.h' EXIT INT QUIT TERM HUP;\
     46 	awk -f generror.awk cc2.h > $$$$.h && mv $$$$.h $@
     47 
     48 cc2-amd64-sysv: $(LIBSCC) $(OBJS) amd64-sysv/builtin.o
     49 	$(CC) $(PROJ_LDFLAGS) $(OBJS) amd64-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     50 
     51 cc2-i386-sysv: $(LIBSCC) $(OBJS) i386-sysv/builtin.o
     52 	$(CC) $(PROJ_LDFLAGS) $(OBJS) i386-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     53 
     54 cc2-qbe_amd64-sysv: $(LIBSCC) $(OBJS) qbe_amd64-sysv/builtin.o
     55 	$(CC) $(PROJ_LDFLAGS) $(OBJS) qbe_amd64-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     56 
     57 cc2-qbe_arm64-sysv: $(LIBSCC) $(OBJS) qbe_arm64-sysv/builtin.o
     58 	$(CC) $(PROJ_LDFLAGS) $(OBJS) qbe_arm64-sysv/builtin.o $(PROJ_LDLIBS) -o $@
     59 
     60 cc2-z80-scc: $(LIBSCC) $(OBJS) z80-scc/builtin.o
     61 	$(CC) $(PROJ_LDFLAGS) $(OBJS) z80-scc/builtin.o $(PROJ_LDLIBS) -o $@
     62 
     63 clean:
     64 	rm -f error.h