|
1 |
| -#DEPS = function.h |
2 |
| -#LIB_OBJS = function.o |
| 1 | + |
| 2 | +# Guide used while writing this makefile is |
| 3 | +# https://stackoverflow.com/questions/68428103/how-to-create-a-makefile-for-a-c-project-with-multiple-directories |
| 4 | + |
3 | 5 |
|
4 | 6 | # https://stackoverflow.com/questions/18007326/how-to-change-default-values-of-variables-like-cc-in-makefile
|
5 | 7 | ifeq ($(origin CC),default)
|
6 | 8 | CC = gcc
|
7 | 9 | endif
|
8 | 10 |
|
9 |
| -BLOB_STAMPER_OBJ = blobstamper/blob.o \ |
10 |
| -blobstamper/helpers.o \ |
11 |
| -blobstamper/stamp.o \ |
12 |
| -blobstamper/stamp_arithm.o \ |
13 |
| -blobstamper/stamp_dict.o \ |
14 |
| -blobstamper/galley.o \ |
15 |
| -blobstamper/dict.o \ |
| 11 | +BLOBSTAMPER_SRC := $(wildcard blobstamper/*.cpp) |
| 12 | +BLOBSTAMPER_OBJ := $(addsuffix .o, $(basename $(BLOBSTAMPER_SRC))) |
16 | 13 |
|
17 |
| -.PHONY: all blob-stamper-all blob-stamper-clean clean test |
| 14 | +.PHONY: all blob-stamper-all blob-stamper-clean clean test gagaga |
18 | 15 |
|
19 |
| -#all: blob-stamper-all test_dict $(WRAPPERS_OBJ) |
20 |
| -all: blob-stamper-all |
| 16 | +all: $(BLOBSTAMPER_OBJ) |
21 | 17 | @echo All done!
|
22 | 18 |
|
23 |
| -blob-stamper-all: |
24 |
| - $(MAKE) -C blobstamper |
| 19 | +blobstamper/%.o: blobstamper/%.cpp |
| 20 | + $(CXX) -c -g $(CXXFLAGS) $< -o $@ |
| 21 | + |
| 22 | + |
| 23 | +# blob-stamper-all: |
| 24 | +# $(MAKE) -C blobstamper |
| 25 | + |
| 26 | +#%.o: %.cpp $(DEPS) |
| 27 | +# $(CXX) -c -g $(CFLAGS) $< |
| 28 | + |
| 29 | +#%.o: %.c $(DEPS) |
| 30 | +# $(CC) -c -g $(CXXFLAGS) $< |
25 | 31 |
|
26 |
| -%.o: %.cpp $(DEPS) |
27 |
| - $(CXX) -c -g $(CFLAGS) $< |
28 | 32 |
|
29 |
| -%.o: %.c $(DEPS) |
30 |
| - $(CC) -c -g $(CXXFLAGS) $< |
31 | 33 |
|
32 | 34 | blob-stamper-clean:
|
| 35 | + rm -f *.o |
| 36 | + |
| 37 | +clean: blob-stamper-clean |
33 | 38 | $(MAKE) -C blobstamper clean
|
34 | 39 | $(MAKE) -C t clean
|
35 | 40 | $(MAKE) -C libtappp clean
|
36 |
| - |
37 |
| -clean: blob-stamper-clean |
38 |
| - rm -f *.o |
39 | 41 | @echo Clean done!
|
40 | 42 |
|
41 | 43 | test:
|
|
44 | 46 | #test_dict: test_dict.o blob-stamper-all
|
45 | 47 | # $(CXX) $(LDFLAGS) [email protected] -o $@ $(BLOB_STAMPER_OBJ)
|
46 | 48 |
|
| 49 | + |
| 50 | +gagaga: |
| 51 | + @echo ------- $(BLOBSTAMPER_OBJ) |
| 52 | + |
| 53 | +#all: blob-stamper-all test_dict $(WRAPPERS_OBJ) |
| 54 | +#all: blob-stamper-all $(WRAPPERS_OBJ) |
| 55 | +# @echo All done! |
0 commit comments