summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4a6b232..444323d 100644
--- a/Makefile
+++ b/Makefile
@@ -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)