diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-01-22 14:44:36 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-01-22 14:44:36 +0100 |
commit | ec12087e594b563fdff079be5fa64da8aa27ad57 (patch) | |
tree | f19ab48ab5ac12505c4edf9e1a8795826e17d1cb /Makefile | |
parent | Rename hash_help.inc => hash.inc. (diff) | |
download | calp-ec12087e594b563fdff079be5fa64da8aa27ad57.tar.gz calp-ec12087e594b563fdff079be5fa64da8aa27ad57.tar.xz |
Makefile now places .o files in subdir.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -3,18 +3,22 @@ CC := gcc LEX := flex +DIRS := obj + CFLAGS = -Wall -DSAFE_STR -DSAFE_HASH -ggdb #LFLAGS = #LDFLAGS = C_FILES = $(wildcard *.c) INC_FILES = $(wildcard *.inc) -O_FILES = $(C_FILES:.c=.o) +O_FILES = $(addprefix obj/,$(C_FILES:.c=.o)) H_FILES = $(wildcard *.h) +$(shell mkdir -p $(DIRS)) + all: parse -%.o : %.c $(H_FILES) $(INC_FILES) +obj/%.o : %.c $(H_FILES) $(INC_FILES) $(CC) -c -o $@ $< ${CFLAGS} parse: $(O_FILES) @@ -22,4 +26,4 @@ parse: $(O_FILES) clean: -rm parse - -rm *.o + -rm obj/*.o |