summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2016-05-15 22:30:26 +0100
committerFreeArtMan <dos21h@gmail.com>2016-05-15 22:30:26 +0100
commit852c7ad1af2e3283425dccd79b0923b7df12a388 (patch)
treef97e6498f87380091bf6848d06482bf12c258b63 /Makefile
parent44dedb90f005bb0de9bddbd592a5c78f28bc67d1 (diff)
downloadihe-852c7ad1af2e3283425dccd79b0923b7df12a388.tar.gz
ihe-852c7ad1af2e3283425dccd79b0923b7df12a388.zip
Moved to new cmd.
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)