cmd.cをstruct.cに吸収合併
[YACASL2.git] / src / Makefile
index 187a690..01bec4f 100644 (file)
@@ -1,24 +1,29 @@
-INCLUDE = ../include
-CC = gcc
-CFLAGS = -g -Wall -I $(INCLUDE)
+INCLUDE := ../include
+CC := gcc
+CFLAGS := -g -Wall -Wextra -I $(INCLUDE)
+RM := rm -f
 
-COMMONSRC = word.c cmem.c cerr.c
-CASL2SRC = struct.c cmd.c hash.c
-ASSRC = assemble.c token.c label.c
-EXECSRC = exec.c dump.c
+COMMONSRC := word.c cmem.c cerr.c
+CASL2SRC := struct.c hash.c
+ASSRC := assemble.c token.c label.c
+EXECSRC := exec.c dump.c
 
 .PHONY: all clean
 
 all: ../casl2 ../comet2 ../dumpword
+       @rm -f *.o
 
 ../casl2: casl2.o $(subst .c,.o,$(COMMONSRC) $(CASL2SRC) $(ASSRC) $(EXECSRC))
        $(CC) $(CFLAGS) -o $@ $^
+       @rm -f *.d
 
 ../comet2: comet2.o $(subst .c,.o,$(COMMONSRC) $(CASL2SRC) $(EXECSRC))
        $(CC) $(CFLAGS) -o $@ $^
+       @rm -f *.d
 
 ../dumpword: dumpword.o $(subst .c,.o,$(COMMONSRC))
        $(CC) $(CFLAGS) -o $@ $^
+       @rm -f *.d
 
 %.o: %.c
        $(CC) -c $(CFLAGS) $<
@@ -32,4 +37,5 @@ TAGS: $(INCLUDE)/*.h *.c
        @if test `which etags`; then etags $^; fi
 
 clean:
-       @rm -f ../casl2 ../comet2 ../dumpword *.o *.d
+       @rm -f ../casl2 ../comet2 ../dumpword
+       @rm -f *.o *.d