swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame^] | 1 | jmk_project := mkinitrd |
| 2 | jmk_target = mkinitrd |
| 3 | ROOT := /home/ch/dev/bluejay |
| 4 | ASM ?= nasm |
| 5 | CC ?= gcc |
| 6 | LD ?= ld |
| 7 | CFLAGS += -I$(ROOT)/include |
| 8 | |
| 9 | all: $(jmk_target) |
| 10 | |
| 11 | CFLAGS += -O2 |
| 12 | CFLAGS += -Wall -Wno-unused-function -Wno-unused-variable |
| 13 | |
| 14 | .c.o: |
| 15 | $(CC) -c $< -o $@ $(CFLAGS) |
| 16 | |
| 17 | |
swissChili | b3abcd9 | 2021-03-02 20:00:44 -0800 | [diff] [blame] | 18 | OBJECTS = main.o |
swissChili | b3abcd9 | 2021-03-02 20:00:44 -0800 | [diff] [blame] | 19 | |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame^] | 20 | jmk_custom_phony += install |
swissChili | f46600c | 2021-03-03 12:35:33 -0800 | [diff] [blame] | 21 | install: mkinitrd |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame^] | 22 | cp $< $(ROOT)/bin |
| 23 | |
| 24 | $(jmk_target): $(OBJECTS) |
| 25 | $(CC) -o $@ $^ $(CFLAGS) |
swissChili | f46600c | 2021-03-03 12:35:33 -0800 | [diff] [blame] | 26 | |
swissChili | b3abcd9 | 2021-03-02 20:00:44 -0800 | [diff] [blame] | 27 | clean: |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame^] | 28 | rm -f *.o *.a *.so $(jmk_target) |
swissChili | b3abcd9 | 2021-03-02 20:00:44 -0800 | [diff] [blame] | 29 | |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame^] | 30 | Makefile: Jmk |
| 31 | cd "/home/ch/dev/bluejay" && ./bin/jmk |
| 32 | |
| 33 | .PHONY: $(jmk_libs_phony) $(jmk_custom_phony) clean all |