diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,17 +1,21 @@ PROJECT=ihe CC=gcc -CFLAGS= +CFLAGS=-I./ SOURCES=buf.c core.c +SOURCES+=$(wildcard cmd/*.c) OBJECTS=$(SOURCES:.c=.o) LIB_OBJECTS=libcmd/libcmd.o libterm/libterm.o all: clean $(OBJECTS) $(PROJECT) $(PROJECT): - $(CC) $(CFLAGS) $(OBJECTS) $(LIB_OBJECTS) $(PROJECT).c -o $(PROJECT) + $(CC) -c $(PROJECT).c + ld -r $(OBJECTS) $(PROJECT).o -o $(PROJECT)_.o + + $(CC) $(CFLAGS) $(PROJECT)_.o $(LIB_OBJECTS) -o $(PROJECT) %.o: %.c - $(CC) $(CFLAGS) -c $< + $(CC) $(CFLAGS) -c $< -o $@ clean: rm -f $(PROJECT) |