:: Re: [DNG] Is netman being adopted o…
Kezdőlap
Delete this message
Reply to this message
Szerző: Rainer Weikusat
Dátum:  
Címzett: dng
Tárgy: Re: [DNG] Is netman being adopted or was it a waste of time and effort?
Edward Bartolo <edbarx@???> writes:

[...]

> Regarding adding an obj and bin directories, there is a complication
> as netman is two projects in one: GUI frontend written in Lazarus
> Object Pascal and the backend written in C. I would appreciate if more
> direction is given to me in this regard.


There are basically two options for that: Automate the workround
commands, eg, use a backend_src Makefile which looks like this:

-----
# Makefile for cli_backend

CC=gcc

OBJECTS=\
    obj/backend.o \
    obj/caller.o \
    obj/core_functions.o \
    obj/file_functions.o \
    obj/essid_encoder.o


CFLAGS += -Wall -Wextra -Iinclude -g -O2
#CFLAGS += -Wall -Wextra -Iinclude -ggdb

all: $(OBJECTS) bin/backend

clean:
    rm -f $(OBJECTS) bin/backend


bin/backend: $(OBJECTS) bin
    $(CC) -o $@ $(OBJECTS)


obj/%.o : src/%.c obj
    $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<


bin obj:
    mkdir $@
-----


This will create the directories in case they don't exist.

Or (that's what I usually do), force git to keep the directories by adding
them as follows:

mkdir bin obj
touch bin/.keep obj/.keep
git add bin/.keep obj/.keep
git commit -m 'build directories' -a

IMHO, the Makefile should build the software and not "dynamically" fight
the SCM but I don't see a big difference.