Improved the makefile
This commit is contained in:
parent
f104412768
commit
ee98de4701
11
makefile
11
makefile
@ -3,22 +3,21 @@
|
|||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-Wall -g
|
CFLAGS=-Wall -g
|
||||||
OBJS=text.o page.o line.o prompt.o
|
OBJS=text.o page.o line.o prompt.o
|
||||||
|
HEADERS=$(subst .o,.h,$(OBJS)) # text.h page.h ...
|
||||||
LIBS=-lncurses
|
LIBS=-lncurses
|
||||||
|
|
||||||
text: $(OBJS)
|
text: $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o text $(OBJS) $(LIBS)
|
$(CC) $(CFLAGS) -o text $(OBJS) $(LIBS)
|
||||||
|
|
||||||
text.o: text.c text.h page.h line.h prompt.h
|
text.o: text.c $(HEADERS)
|
||||||
$(CC) $(CFLAGS) -c text.c
|
$(CC) $(CFLAGS) -c text.c
|
||||||
|
|
||||||
page.o: page.c page.h line.h
|
page.o: page.c page.h line.h
|
||||||
$(CC) $(CFLAGS) -c page.c
|
$(CC) $(CFLAGS) -c page.c
|
||||||
|
|
||||||
line.o: line.c line.h
|
|
||||||
$(CC) $(CFLAGS) -c line.c
|
|
||||||
|
|
||||||
prompt.o: prompt.c prompt.h
|
# '$<' expands to first prerequisite file
|
||||||
$(CC) $(CFLAGS) -c prompt.c
|
%.o: %.c %.h
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJS) text
|
rm -f $(OBJS) text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user